package com.wei.health.constant;


import com.wei.health.model.vo.RequestVo;
import com.wei.health.util.JsonUtils;
import com.wei.health.util.PublicUtils;

import javax.servlet.http.HttpServletRequest;

public class SysConstant {

	public static final String CHARACHER = "UTF-8";

	public static final String INIT_FIELD_REQUEST_IP = "ip";
	public static final String INIT_FIELD_REQUEST_REQUEST_ID = "requestId";
	public static final String INIT_FIELD_REQUEST_USER_AGENT = "userAgent";
	public static final String INIT_FIELD_REQUEST_BASE_PATH = "basePath";
	public static final String INIT_FIELD_REQUEST_VO = "requestVo";
	public static final String INIT_FIELD_USER_VO = "user";

	/** 获取初始化数据 **/
	public static RequestVo getRequestVo(HttpServletRequest request) {
		return JsonUtils.toObj(PublicUtils.getAttribute(request, INIT_FIELD_REQUEST_VO), RequestVo.class);
	}

}